<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>游戏结束</title>
	<style type="text/css">
		table{
			width: 100%;
			border-collapse: collapse;
		}
		tr{
			height:50px;
		}
		td{
			text-align: center;
			border-top: 1px solid #999;
		}
	</style>
</head>
<body>
	<div>返回游戏</div>
	<div id="container">
		<table>
			<thead>
				<tr>
					<th>玩家</th>
					<th>时间</th>
					<th>分数</th>
				</tr>
			</thead>
			<tbody>
				
			</tbody>
		</table>
	</div>
</body>
<script>
	var records = JSON. parse( localstorage . getItem( "records" ));
	
	var tbdy = document.querySelector("tbody");
	
	records.reverse().forEach(function(ele){
		var tr = document.createElement("tr");
		for (const key in ele) {
			if (ele.hasOwnProperty(Key)) {
		  		var td = document.createElement("td");
		  		tr.appendChild(td);
		  		td.textContent = ele[key];
		  	}
		 }
		  tbody.appendChild(tr);
		})
	
	
	
</script>

</html>